3e397e66AyyD5fYraAySWuwi9uqSXg xen/common/ac_timer.c
3ddb79bddEYJbcURvqqcx99Yl2iAhQ xen/common/block.c
3ddb79bdrqnW93GR9gZk1OJe1qK-iQ xen/common/brlock.c
+3fa152581E5KhrAtqZef2Sr5NKTz4w xen/common/debug.c
3ddb79bdLX_P6iB7ILiblRLWvebapg xen/common/dom0_ops.c
3e6377e4i0c9GtKN65e99OtRbw3AZw xen/common/dom_mem_ops.c
3ddb79bdYO5D8Av12NHqPeSviav7cg xen/common/domain.c
--- /dev/null
+/*
+ * debug.c
+ *
+ * xen pervasive debugger
+ */
+
+#include <xeno/config.h>
+#include <xeno/types.h>
+#include <xeno/lib.h>
+#include <hypervisor-ifs/dom0_ops.h>
+#include <xeno/sched.h>
+#include <xeno/event.h>
+
+#define DEBUG_TRACE
+#ifdef DEBUG_TRACE
+#define TRC(_x) _x
+#else
+#define TRC(_x)
+#endif
+
+void pdb_do_debug (dom0_op_t *op)
+{
+ op->u.debug.status = 0;
+ op->u.debug.out1 = op->u.debug.in2 + 10;
+ op->u.debug.out2 = op->u.debug.in1 + 100;
+
+ TRC(printk("PDB: op:%c, dom:%x, in1:%x, in2:%x\n",
+ op->u.debug.opcode, op->u.debug.domain,
+ op->u.debug.in1, op->u.debug.in2));
+
+ if (op->u.debug.domain == 0)
+ {
+ op->u.debug.status = 1;
+ return;
+ }
+
+ switch (op->u.debug.opcode)
+ {
+ case 'r' :
+ {
+ struct task_struct * p = find_domain_by_id(op->u.debug.domain);
+ if ( p != NULL )
+ {
+ if ( (p->flags & PF_CONSTRUCTED) != 0 )
+ {
+ wake_up(p);
+ reschedule(p);
+ }
+ put_task_struct(p);
+ }
+ else
+ {
+ op->u.debug.status = 2; /* invalid domain */
+ }
+ break;
+ }
+ case 's' :
+ {
+ unsigned long cpu_mask;
+ struct task_struct * p = find_domain_by_id(op->u.debug.domain);
+
+ if (p != NULL)
+ {
+ if (p->state != TASK_SUSPENDED)
+ {
+ cpu_mask = mark_hyp_event(p, _HYP_EVENT_STOP);
+ hyp_event_notify(cpu_mask);
+ }
+ put_task_struct(p);
+ }
+ else
+ {
+ op->u.debug.status = 2; /* invalid domain */
+ }
+ break;
+ }
+ default :
+ {
+ printk("PDB error: unknown debug opcode %c (0x%x)\n",
+ op->u.debug.opcode, op->u.debug.opcode);
+ }
+ }
+ return;
+}
* TASK_UNINTERRUPTIBLE: Domain is blocked but may not be woken up by an
* arbitrary event or timer.
* TASK_WAIT: Domains CPU allocation expired.
- * TASK_SUSPENDED: Domain is in supsended state (eg. start of day)
+ * TASK_SUSPENDED: Domain is suspended (startofday or pervasive debugger)
* TASK_DYING: Domain is about to cross over to the land of the dead.
*
* If you update these then please update the mapping to text names in